import { useRouter } from 'vue-router'

export default function useSortData() {
  const router = useRouter()
  // 替换模板
  const replaceTemplate = () => {
    console.log('替换模板')
    router.push({ name: 'addBusiness', params: {
      active: 2
    } })
  }
  // 添加业务
  const addBussiness = () => {
    console.log('添加业务', router)
    router.push({ name: 'addBusiness' })
  }
  // 全选
  const selectQuestion = () => {

  }
  // 禁启用
  const switchStatus = () => {
    console.log('禁启用')
  }
  // 编辑
  const editRule = () => {
    console.log('编辑')
  }
  // 选中当前行
  const onRowClick = (row, column, event) => {
    console.log(row, column, event)
  }
  return {
    replaceTemplate,
    addBussiness,
    selectQuestion,
    switchStatus,
    editRule,
    onRowClick
  }
}